home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / text / misc / port / string / strchr.s < prev    next >
Encoding:
Text File  |  1996-09-07  |  266 b   |  20 lines

  1.  
  2.     XDEF    StrChr
  3.  
  4. ; StrChr() - Finds first character D0 location in string in A0.
  5.  
  6. ; Result:
  7. ; D0 = 0 if character was not found, or the address where found.
  8.  
  9. StrChr:
  10.     cmp.b    (a0),d0
  11.     beq.b    .Found
  12.     tst.b    (a0)+
  13.     bne.b    StrChr
  14.     moveq    #0,d0
  15.     rts
  16.  
  17. .Found:
  18.     move.l    a0,d0
  19.     rts
  20.